# _*_ coding: UTF-8 _*_
# @Time     : 2021/11/2 17:33
# @Author   : Gong Yangyi
# @Site     : http://www.hzdledu.cn/
# @File     : prac.py
# @Software : PyCharm

from selenium import webdriver
import time
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.wait import WebDriverWait  # 等待类
from selenium.webdriver.support import expected_conditions  # 等待条件
from selenium.webdriver.common.by import By  # 定位符
from selenium.webdriver.common.keys import Keys  # 特殊按键类导入

#在百度地图。练习
def foo1():
    driver=webdriver.Chrome()
    driver.maximize_window()
    driver.get('https://map.baidu.com/@13373075,3519024,15z')

    ActionChains(driver).double_click().pause(1).move_by_offset(500, 0).pause(1).release().perform()
    driver.find_element_by_xpath(f'//*[@id="sole-input"]').send_keys('上天竺法喜讲寺')
    driver.find_element_by_xpath(f'//*[@id="sole-input"]').send_keys(Keys.ENTER)
    time.sleep(3)
    driver.find_element_by_xpath(f'//*[@id="card-1"]/div/ul/li[1]/div[1]/div[3]/div[1]/span/a').click()
    time.sleep(3)


    driver.quit()

if __name__ == '__main__':
    foo1()



